<?php
	session_start();
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Won-松的趣味分享</title>
	<link rel="stylesheet" type="text/css" href="../css/bass.css"/>
	<link rel="stylesheet" type="text/css" href="../css/funstyle.css"/>
</head>
<body>
	<?php
		error_reporting(E_ERROR | E_WARNING | E_PARSE);
		$s = $_SESSION["is_login"];
		if ($s=='ok') {
	?>
	<?php
		$id = $_GET['id'];
		include('../function.php');
		$conn = conn();
		if ($_POST) {
				$conn = conn();
				$class = $_POST['class'];
				$sql = "update cata_log set `class`='$class' where id=$id";
				mysqli_query($conn,$sql);
				header("Location:catalog.php");
			}
		$sql = "select * from cata_log where id=$id";
		$resourse = mysqli_query($conn,$sql); 
		$data = mysqli_fetch_assoc($resourse);
	?>
	<div class="form">
		<form action="" method="post">
		<div class="head"><b>编辑分类</b></div>
			<input type="text" name="class" value="<?=$data['class']?>" />
			<div><input type="submit"  /></div>
			<a href="catalog.php">返回</a>
		</form>
	</div>
	<?php
		}
	?>
</body>
</html>